package cc.comac.mom.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipPatrolCheckWorkOrderItemService;
import cc.comac.mom.bean.EquipPatrolCheckWorkOrderItem;
import cc.comac.mom.bean.EquipPatrolCheckWorkOrderItemBean;
import cc.comac.mom.util.ResultBean;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "/EquipPatrolCheckWorkOrderItem")
public class EquipPatrolCheckWorkOrderItemController {

	@Autowired
	private EquipPatrolCheckWorkOrderItemService equipPatrolCheckWorkOrderItemService;
	
	@ApiOperation("批量删除巡检计划工单项")
	@RequestMapping("/deleteBatch")
	public ResultBean deleteBatch(@RequestBody List<Long> ids) {
		return equipPatrolCheckWorkOrderItemService.deleteBatch(ids);
	}
	
	@ApiOperation("巡检计划工单项执行")
	@RequestMapping("/planExecute")
	public ResultBean planExecute(@RequestBody EquipPatrolCheckWorkOrderItem obj) {
		return equipPatrolCheckWorkOrderItemService.planExecute(obj);
	}

	@ApiOperation("确认")
	@RequestMapping("/planItemConfirm")
	public ResultBean confirm(@RequestBody List<EquipPatrolCheckWorkOrderItem> obj) {
		return equipPatrolCheckWorkOrderItemService.confirm(obj);
	}
	
	@ApiOperation("查询巡检计划工单项")
	@RequestMapping("/selectByFields")
	public ResultBean selectByFields(@RequestBody EquipPatrolCheckWorkOrderItemBean obj) {
		 return equipPatrolCheckWorkOrderItemService.selectByFields(obj);
	}
}
